<form id="store-locations-form" name="store-locations-form" method="post" action="albumsizes-add-at-once.php">
<h1><a name="manage" id="manage"></a>Manage store locations</h1>
<table class="data" id="data-table">
<thead>
	<tr>
	    <th>?</th>
	    <th>Name</th>
	    <th>Prposed store locations</th>
        <th>Add?</th>
	</tr>
</thead>
<tbody>
	{section loop=$store_locations name='sl'}
    <tr class="{cycle values='A,B'}">
		<td><input type="checkbox" name="choose[{$store_locations[sl].size_id}]" value="checkbox" /></td>
		<td>{$store_locations[sl].size_id}: {$store_locations[sl].size_name}</td>
		<td>
			{if !$store_locations[sl].store_location}
				<input type="text" name="store_locations[{$store_locations[sl].size_id}]" id="sl-{$store_locations[sl].size_id}" value="{$album_id|propose:$store_locations[sl].size_id}" proposed="{$album_id|propose:$store_locations[sl].size_id}" />
			{else}
				<input type="text" name="store_locations[{$store_locations[sl].size_id}]" value="{$store_locations[sl].store_location}" />
			{/if}
		</td>
	    <td>
		{if !$store_locations[sl].store_location}
			<a href="#" onclick="document.getElementById('sl-{$store_locations[sl].size_id}').value=document.getElementById('sl-{$store_locations[sl].size_id}').getAttribute('proposed');return false;">proposed</a> |
			<a href="#" onclick="document.getElementById('sl-{$store_locations[sl].size_id}').value='';return false;">cancel</a>
		{else}
			{$store_locations[sl].store_location|validdirectory}
		{/if}</td>
    </tr>
	{sectionelse}
	<tr>
		<td>-</td>
		<td>-</td>
		<td>Manage sizes first.</td>
	    <td>-</td>
	</tr>
	{/section}
	<tr>
		<td>&nbsp;</td>
		<td><input type="hidden" name="id" value="{$smarty.get.id}" /></td>
		<td>
			<input type="submit" name="Submit" value="Submit" />
			<span class="warning" style="color:#FF0000">Empty the store location if image size is not useful</span>
		</td>
	    <td>&nbsp;</td>
	</tr>
</tbody>
</table>
<p><strong>Note</strong>: If image store locations are not defined correctly, it will NOT generate the thumbnail images.</p>
</form>